package com.hwy.struts.utils;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	private static Configuration configuration;
	static {
		configuration = new Configuration().configure();
		
	}
	
	public static Session openSession() {
		return configuration.buildSessionFactory().openSession();
	}
	
	public static Session getCurrentSession() {
		return configuration.buildSessionFactory().getCurrentSession();
	}
}
